﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using StyleMVVM.DependencyInjection;

namespace StyleMVVM.MVC.Extensions
{
	public class StyleDependencyResolver : IDependencyResolver
	{
		private IDependencyInjectionContainer container;

		public StyleDependencyResolver(IDependencyInjectionContainer container)
		{
			this.container = container;
		}

		public object GetService(Type serviceType)
		{
			return container.LocateByType(serviceType);
		}

		public IEnumerable<object> GetServices(Type serviceType)
		{
			return container.LocateAllByType(serviceType);
		}
	}
}